feat(llm): allow configuring a default model per provider#10009
feat(llm): allow configuring a default model per provider#10009Halone228 wants to merge 3 commits into
Conversation
Adds an optional 'Model' field to the AI provider configuration dialog. When set, the model is injected into the available models list as the default and used as a fallback in chat requests. - Add model?: string to LlmProviderConfig (client) and LlmProviderSetup (server) - Add model input to AddProviderModal - Show configured model in ProviderList table - Merge configured model into getAllModels() and llm_chat stream - Add translations (en, ru) - Update and extend tests
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to configure an optional model ID for LLM providers, updating both the client UI (provider list and add provider modal) and the server-side LLM service to support this configuration. Feedback on the changes highlights an issue in the server-side model resolution logic where configuring a custom model can result in multiple models being marked as default (isDefault: true) for the same provider, and a code suggestion is provided to ensure only the configured model is marked as default.
When a custom model is configured, unset isDefault on all other models so the client UI never sees multiple defaults for the same provider.
Greptile SummaryThis PR adds an optional Model field to the AI provider configuration, letting users pin a specific model ID per provider. When set, the model is injected as the default in
Confidence Score: 5/5Safe to merge; the feature is additive and purely opt-in — omitting the new field leaves all existing behavior unchanged. All changed paths are guarded by optional fields with clear fallbacks. The model-injection logic in getAllModels correctly handles both the 'model already in list' and 'model not in list' cases and strips isDefault from other entries. The streamChat fallback chain (config.model → setup.model → provider default → error) is well-structured. The one gap (handler-level test for the setup.model fallback) is a coverage nit that does not affect correctness. No files require special attention; the test gap in llm_chat.spec.ts is the only item worth a follow-up. Important Files Changed
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Adds an optional 'Model' field to the AI provider configuration dialog. When set, the model is injected into the available models list as the default and used as a fallback in chat requests.
Related to #10008